﻿using EasyLinkerSDK.Enum;
using EasyLinkerSDK.Model.Server.Common.Interface;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;

namespace EasyLinkerSDK.Model.Server.Control
{
    public class SetBrightnessData : IServerData
    {
        private int _value = 0;

        [JsonConverter(typeof(StringEnumConverter))]
        public PropertiyType Propertiy { get; set; }

        public AdjustType AdjustType { get; set; }

        /// <summary>
        /// 亮度具体值，最大为100，最小为0
        /// </summary>
        public int Value
        {
            get
            {
                return _value;
            }
            set
            {
                if (value <= 0)
                {
                    _value = 0;
                }
                else if (value >= 100)
                {
                    _value = 100;
                }
                else
                {
                    _value = value;
                }
            }
        }

        public string Custom { get; set; }

    }
}
